#ifndef AUTOMATA_H
#define AUTOMATA_H

#include <string>
#include <set>
#include <map>

using namespace std;

typedef string state;
typedef char symbol;
typedef set<symbol> alphabet;

class automata {
	public:
		automata(char *desc_file);
		~automata();
		virtual symbol get_input() = 0;
		virtual void on_input(symbol s) = 0;
		virtual state run() = 0;
		virtual bool accept() = 0;
	private:
		set<state> states;
		state start_state;
		set<state> accept_states;
};

// Deterministic Finite Automaton
class dfa : public automata {
	public:
		fa(char *desc_file);
		~fa();
		symbol get_input();
		void on_input(symbol s);
		state run();
		bool accept();
	private:
		map< pair<state, symbol>, state > trans_func;
};

#endif
